# Makefile for the SPriG library
#ported by kehon SPriG library for SDL for psp

PSPSDK=$(shell psp-config --pspsdk-path)
PSPDEV=$(shell psp-config --psp-prefix)
PSPBIN=$(PSPDEV)/bin
INSTALL_DIR=$(shell $(PSPBIN)/sdl-config --prefix)/include/SDL

TARGET_LIB = libsprig.a

include Makefile.conf

OBJECTS=SPG_surface.o SPG_primitives.o SPG_polygon.o SPG_rotation.o SPG_misc.o
OBJS = $(OBJECTS) 

CFLAGS += -O2 -G0 -Wall -g
CFLAGS += $(SPRIG_CFLAGS) -fPIC
LIBS = $(SPRIG_LIBS)

SPRIG_VER = 1
SPRIG_VER_MINOR = 0
SPRIG_VER_BUGFIX = 0

include $(PSPSDK)/lib/build.mak

config:

ifneq ($(QUIET),y)
	@echo "== SPriG v$(SPRIG_VER).$(SPRIG_VER_MINOR).$(SPRIG_VER_BUGFIX)"
endif

install:	
	@mkdir -p $(INSTALL_DIR)
	cp -f sprig.h $(INSTALL_DIR)
	cp -f sprig_inline.h $(INSTALL_DIR)
	@mkdir -p $(shell $(PSPBIN)/sdl-config --prefix)/lib
	cp -f $(TARGET_LIB) $(shell $(PSPBIN)/sdl-config --prefix)/lib
	@echo
	@echo "** Headerfiles installed in $(PREFIX_H)"
	@echo "** Library files installed in $(PREFIX)/lib"
